package com.huabo.system.oracle.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.system.oracle.entity.TblMonitorIndicatorresult;

import java.math.BigDecimal;

public class TblMonitorIndicatorresultMapperSqlConfig {


    public String getResultListJKZX(PageInfo<TblMonitorIndicatorresult> pageInfo, BigDecimal indicatorid, BigDecimal solutionresultid) {
        StringBuffer sbSql = new StringBuffer("SELECT * FROM ( SELECT BUDGET.*,ROWNUM RNUM FROM ( SELECT * FROM TBL_MONITOR_INDICATORRESULT where RESULTID =(select RESULTID from (SELECT RESULTID FROM TBL_MONITOR_INDICATORRESULT WHERE SOLUTIONRESULTID= '"+solutionresultid+"' and INDICATORID= '"+indicatorid+"' and SOURCE=3 order by savetime desc) where rownum =1) ");


        sbSql.append(" ) BUDGET WHERE rownum <= "+(pageInfo.getCurrentPage()*pageInfo.getPageSize())+" ) WHERE RNUM > "+pageInfo.getCurrentRecord());
        String sql = sbSql.toString();
        return sql;
    }
}
